package com.newjiabo.applet.controller;

import com.newjiabo.common.core.domain.AjaxResult;
import com.newjiabo.ski.domain.SkiMoreServices;
import com.newjiabo.ski.domain.SkiSetMeal;
import com.newjiabo.ski.domain.enums.SetMealStatus;
import com.newjiabo.ski.service.ISkiMoreServicesService;
import com.newjiabo.ski.service.ISkiSetMealService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * {类内容}
 *
 * @author CaoMengHui.
 * @version 1.0
 * @since 2023/9/23 14:52
 */
@RestController
@RequestMapping("/applet/setMeal")
@Api(tags = "小程序-获取套餐信息/更多服务信息")
public class SetMealController {
    @Resource
    private ISkiSetMealService setMealService;
    @Resource
    private ISkiMoreServicesService moreServicesService;

    @ApiOperation(value = "获取套餐信息接口")
    @GetMapping(value = "/getSetMeal/{snowFieldId}")
    public AjaxResult getSetMeal(@PathVariable String snowFieldId) {
        List<SkiSetMeal> skiSetMealList = setMealService.getBySnowFieldId(snowFieldId, SetMealStatus.OPEN);
        return AjaxResult.success(skiSetMealList);
    }

    @ApiOperation(value = "获取更多套餐id")
    @GetMapping(value = "/getMoreService/{setMealId}")
    public AjaxResult getMoreService(@PathVariable String setMealId){
        List<SkiMoreServices> moreServicesList = moreServicesService.getBySetMealId(setMealId,true);
        return AjaxResult.success(moreServicesList);
    }
}
